<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{padding: 0;margin: 0; }
        #list{
            width:350px;
            border: 1px solid #ccc;
            margin: 100px auto;
        }
        #list ul{
            list-style-type: none;
            background: #008ce1;
        }
        .clearFix:after{
            content: "";
            width: 0;
            height: 0;
            visibility: hidden;
            clear: both;
            display: block;
        }
        #list ul li {
            width: 100px;
            height: 40px;
            float: left;
            text-align: center;
            line-height: 40px;
        }
        #list ul li a{
            text-decoration: none;
            color: #ffffff;
            display: block;
        }
        .color{
            background: #ff5d54;
        }
        #list #list_content div{
            height: 300px;
            border-bottom:1px solid #ccc;
            text-align: center;
            line-height: 300px;
            display: none;
        }
        .a1{
            text-decoration: none;
            display: block;
            width: 100px;
            height: 50px;
            background: #008ce1;
            color: white;
            margin: 50px auto;
            text-align: center;
            line-height: 50px;
        }
    </style>
</head>
<body>
<div id="list">
    <ul class="clearFix">
        <li><a href="#">第一章</a></li>
        <li><a href="#">第二章</a></li>
        <li><a href="#">第三章</a></li>
    </ul>
    <div id="list_content">
        <div id="list_1">课一</div>
        <div id="list_2">课二</div>
        <div id="list_3">课三</div>
    </div>

</div>
</body>
</html>
<script>
    var list_content=document.getElementById("list_content");
    var div=list_content.getElementsByTagName("div");
    var ali=document.getElementsByTagName("li");
    for (var i=0;i<ali.length;i++){
        ali[i].a=i;
        ali[i].onclick=function(){
            for (i=0;i<ali.length;i++){
                ali[i].className="";
            }
            for (i=0;i<div.length;i++){
                div[i].style.display="none";
            }
            this.className="color";
            div[this.a].style.display="block";
        };

    }
</script>